The 'pop( )' Function can be used to remove an item from the Set. But it does not remove the last element.
As there is no indexing, the 'pop( )' Function could remove any element.
x = {"Mohan", "Kriti", "Salim"} x.pop() print(x)
So, in the above code we have created a 'Set' and initialised to the variable 'x'.
Below is how the values are positioned in the Set,
Next, we have used the 'pop( )' function that can remove any element from the Set.
In this case 'Mohan' is removed from the Set.
And we get the below output,